// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import store from './store';
import { Button, Loading, MessageBox } from 'element-ui';

import atm from '@/assets/1.gif';
//引入插件
import VueLazyload from 'vue-lazyload';
//注册插件
Vue.use(VueLazyload, {
  //懒加载默认的图片
  loading: atm
});

//注册全局组件
Vue.component(Button.name, Button);
//ElementUI注册组件的时候，还有一种写法，挂在原型上
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;

Vue.config.productionTip = false

import '@/plugins/validate'//引入表单验证插件

//三级联动组件--全局
import TypeNav from '@/components/TypeNav';
import Carousel from "@/components/Carousel";
import Pagination from "@/components/Pagination";
Vue.component(TypeNav.name, TypeNav);
Vue.component(Carousel.name, Carousel);
Vue.component(Pagination.name, Pagination);

import '@/mock/mockServe';
import "swiper/css/swiper.css";
import * as API from '@/api';


/* eslint-disable no-new */
export default new Vue({//一定要暴露
  el: '#app',
  router,
  components: { App },
  template: '<App/>',
  store,
  beforeCreate() {
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  render: h => h(App)
}) 
